﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
@using Newtouch.Infrastructure;

<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/validate/jquery.validate.min.js")"></script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 55px;">
        <table class="form">
            <tr>
                <th class="formTitle"><span class="required">*</span>模板类型：</th>
                <td class="formValue">
                    @*@Html.DropDownList("mblx", EnumCfMbLx.department.ToDescSelectList(), "==请选择==", new { @class = "form-control required" })*@
                    <select id="mblx" class="form-control required">
                        <option value="">==请选择==</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle"><span class="required">*</span>模板名称：</th>
                <td class="formValue">
                    <input type="text" id="mbmc" class="form-control required" placeholder="" />
                </td>
            </tr>
        </table>
    </div>
</form>

<script>
    //valid的扩展样式
    var valOptions = {
        errorPlacement: function (error, element) {
            element.parents('.formValue').addClass('has-error');
        }
    };

    $(function () {
        $("#mblx").bindSelect({
            url: "/MedicalRecord/GetMbqxSelectJson",
        });
    });

    function submitForm() {
        if (!$('#form1').formValid(valOptions)) {
            $.modalAlert("必填信息未完善", 'warning');
            return;
        }
        var obj = new Object();
        obj.mbmc = $('#mbmc').val();
        obj.mblx = $('#mblx').val();
        return obj;
    }
</script>

